package com.hy.erp.inventory.pojo;

import java.util.List ;

import javax.persistence.Column ;
import javax.persistence.Entity ;
import javax.persistence.FetchType ;
import javax.persistence.ManyToOne ;
import javax.persistence.OneToMany ;
import javax.persistence.OneToOne ;
import javax.persistence.Table ;

import org.hibernate.annotations.Index ;
//import org.jboss.seam.annotations.Name ;

import com.hy.erp.inventory.dao.interfaces.ICustomerDao;
import com.hy.erp.inventory.pojo.interfaces.IContact;
import com.hy.erp.inventory.pojo.interfaces.ICustomer;
import com.hy.mydesktop.shared.persistence.domain.gxt.MyBaseModel;
//import com.hy.erp.inventory.vsoft.libra.enterprise.framework.persistence.api.annotation.DaoA;
//import com.hy.erp.inventory.vsoft.libra.enterprise.framework.persistence.entity.AbstractPersistentEntity;

/**
 * <ul>
 * <li>开发作者：汤莉</li>
 * <li>设计日期：2010-10-5；时间：下午03:41:51</li>
 * <li>字段类型：long；字段名称：serialVersionUID</li>
 * <li>设计目的：客户信息类</li>
 * </ul>
 * <ul>
 * <b>修订编号：</b>
 * <li>修订日期：</li>
 * <li>修订作者：</li>
 * <li>修订原因：</li>
 * <li>修订内容：</li>
 * </ul>
 */
/*@Entity
@Name("customer")
@Table(name="customers")
@ DaoA ( ICustomerDao.class )*/
//public class Customer extends AbstractPersistentEntity implements ICustomer
public class Customer extends MyBaseModel //implements IPositonType
{

	private static final long	serialVersionUID	=
														6788954797067784184L ;
	
	
	
	/**
	 * 构造方法
	 */
	public Customer(){}

	public Customer( String company, Address address,
			String name, String position, List<Contact> contact,RoleType roleType) {
		super();
		
	}


	//#####################################################################

	
	@Column(name="company",unique=false,nullable=false,insertable=true,updatable=true)
	@Index(name="companyIndex")
	public String getCompany ( )
	{
		return this.get(ICustomer.COMPANY) ;	
	}
	@OneToOne(targetEntity=Address.class,fetch=FetchType.LAZY)
	
	public Address getAddress ( )
	{
		return this.get(ICustomer.ADDRESS) ;	
	}
	@Column(name="name",unique=false,nullable=false,insertable=true,updatable=true)
	public String getName ( )
	{
		return this.get(ICustomer.NAME) ;	
	}
	
	@Column(name="position",unique=false,nullable=false,insertable=true,updatable=true)
	public String getPosition ( )
	{
		return this.get(ICustomer.POSITION) ;	
	}
	
	@OneToMany(targetEntity=Contact.class,fetch=FetchType.LAZY)
	public List<IContact> getContact() {
		return this.get(ICustomer.CONTACT) ;	
	}
	
	@ManyToOne(targetEntity=RoleType.class,fetch=FetchType.LAZY)
	public RoleType getRoleType ( )
	{
		return this.get(ICustomer.ROLETYPE) ;	
	}
	//####################################################
	
	public void setRoleType (
								RoleType roleType )
	{
		super.set (ICustomer.ROLETYPE , roleType );
	}
	public void setCompany (
								String company )
	{
		super.set (ICustomer.COMPANY , company );
	}
	

	public void setAddress (
								Address address )
	{

		super.set (ICustomer.ADDRESS , address );
	}
	public void setName (
							String name )
	{

		super.set (ICustomer.NAME , name );
	}
	public void setPosition (
								String position )
	{

		super.set (ICustomer.POSITION , position );
	}

	public void setContact(List<IContact> contact) {

		super.set (ICustomer.CONTACT , contact );
	}
	
	
}
